package other_其他模式.service_locator_pattern_服务定位模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/10/14:14
 * @Description:
 */
public class InitialContext {

	public Object lookup(String jndiName) {

		if ("service1".equalsIgnoreCase(jndiName)) {
			return new Service1();
		}
		if ("service2".equalsIgnoreCase(jndiName)) {
			return new Service2();
		}

		return null;
	}
}
